﻿<UserControl x:Class="EQual.MainModule.Employees.Views.EmployeeGridView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:dg="http://schemas.microsoft.com/wpf/2008/toolkit"
    xmlns:WpfApplicationExperimental="clr-namespace:WpfApplicationExperimental;assembly=WpfApplicationExperimental"
    xmlns:local="clr-namespace:EQual.MainModule" 
    >
    <UserControl.Resources >
        <local:BinaryToImageConverter  x:Key="ImageSourceConverter" />
    </UserControl.Resources>
    <Grid>
        <dg:DataGrid  Name="dataGrid1"  
                      CanUserAddRows="True"
                      Background="Transparent" 
                      AutoGenerateColumns="False"
                      ItemsSource="{Binding Path=ItemsCollection}" SelectionChanged="dataGrid1_SelectionChanged" RowEditEnding="dataGrid1_RowEditEnding">

            <dg:DataGrid.RowDetailsTemplate >
                <DataTemplate >
                    <Image Source="{Binding Picture,Converter={StaticResource ImageSourceConverter}}" Height="40"/>
                </DataTemplate>
            </dg:DataGrid.RowDetailsTemplate>
                <dg:DataGrid.Columns >
                <dg:DataGridTextColumn Binding="{Binding id}" Header="Id" />
                <dg:DataGridTextColumn Binding="{Binding name}" Header="Name"/>
                <dg:DataGridTextColumn Binding="{Binding surname}" Header="SurName"/>

            </dg:DataGrid.Columns>
        </dg:DataGrid>
    </Grid>
</UserControl>
